Fix the look of the <video> elements in shr
authorLars Ingebrigtsen <larsi@gnus.org>
Wed, 10 Nov 2021 01:31:54 +0000 (02:31 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Wed, 10 Nov 2021 01:31:54 +0000 (02:31 +0100)
* lisp/net/shr.el (shr-tag-video): Tweak the look of the video element.

lisp/net/shr.el

index 9b00ff6aa30aa71df53e5da71560a282588cacc6..71c18ff99479390aa918efb22d64f6d2228c262b 100644 (file)
@@ -1696,7 +1696,7 @@ The preference is a float determined from `shr-prefer-media-type'."
             (xwidget-webkit-execute-script
              widget (format "document.body.innerHTML = %S;"
                             (format
-                             "<video autoplay loop muted><source src=%S type='video/mp4\'></source></video>"
+                             "<style>body { margin: 0px; }</style><div style='background: black; height: 100%%; display: flex; align-items: center; justify-content: center;'><video autoplay loop muted controls style='max-width: 100%%; max-height: 100%%;'><source src=%S type='video/mp4\'></source></video></div>"
                              url)))))
       ;; No xwidgets.
       (if (> (length image) 0)